package com;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.io.File;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder;

import org.apache.commons.io.FileUtils;
import org.eclipse.swt.widgets.Layout;

public class HtmlView1 extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					HtmlView1 frame = new HtmlView1();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public HtmlView1() {
		setSize(600,800);
		setTitle("");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JEditorPane editorPane = new JEditorPane();
		JScrollPane scrollPane = new JScrollPane(editorPane);
		editorPane.setEditable(false);
		editorPane.setText(readString());
		editorPane.setContentType("text/html");
		
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.add(scrollPane,BorderLayout.CENTER);

		setContentPane(contentPane);
	}
	
	public static String readString() {
		try {
		return FileUtils.readFileToString(new File("F:\\works\\git\\java\\ReadPDF\\read-pdf1\\toHTML.html"),"UTF-8");
		}catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
